//
//  MainMessageCell1.m
//  OperationPro
//
//  Created by yaxue wang on 16/11/4.
//  Copyright © 2016年 展鸿科技. All rights reserved.
//

#import "MainMessageCell.h"

@implementation MainMessageCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.headImg=[[UIImageView alloc]init];
        [self addSubview:self.headImg];
        UIImage *img=[UIImage imageNamed:@"Ico_mess_noti"];
        [self.headImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(28);
            make.centerY.equalTo(self);
            make.size.mas_equalTo(CGSizeMake(img.size.width, img.size.height));
        }];
        
        
        self.nameLab = [[UILabel alloc] init];
        [self addSubview:self.nameLab];
        [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.headImg.mas_right).offset(15);
            make.top.equalTo(self).offset(15);
        }];
        [self.nameLab setFont:F(14)];
        [self.nameLab setTextColor:FontColor];
        
        self.redLab = [[UILabel alloc] init];
        [self addSubview:self.redLab];
        [self.redLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.nameLab.mas_right).offset(2);
            make.top.equalTo(self).offset(15);
            make.size.height.mas_equalTo(CGSizeMake(5, 5));
        }];
        self.redLab.layer.masksToBounds=YES;
        self.redLab.layer.cornerRadius=2.5;
        self.redLab.backgroundColor=[UIColor redColor];
        
        self.timeLab = [[UILabel alloc] init];
        [self addSubview:self.timeLab];
        [self.timeLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self).offset(-15);
            make.top.equalTo(self).offset(18);
        }];
        [self.timeLab setFont:F(10)];
        self.timeLab.textAlignment=NSTextAlignmentRight;
        [self.timeLab setTextColor:LightFontColor];
        
        self.contentLab = [[UILabel alloc] init];
        [self addSubview:self.contentLab];
        [self.contentLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.nameLab);
            make.bottom.equalTo(self).offset(-15);
            make.right.equalTo(self).offset(-15);
        }];
        [self.contentLab setFont:F(10)];
        [self.contentLab setTextColor:LightFontColor];
        
        
        self.line = [[UILabel alloc] init];
        [self addSubview: self.line];
        [ self.line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.headImg);
            make.right.equalTo(self).offset(0);
            make.bottom.equalTo(self);
            make.height.equalTo(@.5);
        }];
        [ self.line setBackgroundColor:LineColor];
        
    }
    return self;
}


@end
